package com.xiaoma.map;

import java.util.Iterator;
import java.util.Map.Entry;
import java.util.TreeMap;

/**
 * @author xiaomacdut
 * @date 2020年2月10日 下午1:17:11
 */
public class TreeMapDemo{
    
    public static void main(String [] args){
        TreeMap map = new TreeMap();
        map.put("aa1", "sdfds");
        map.put("ab2a1", "sdfds");
        map.put("b3a1", "sdfds");
        map.put("a5a1", "sdfds");
        Iterator<Entry<String, String>> iterator = map.entrySet().iterator();
        while(iterator.hasNext()){
            Entry<String, String> entry = iterator.next();
            String key = entry.getKey();
            String value = entry.getValue();
            System.out.println(key + ":" + value);
        }
    }
}
